/*
 * @Author: linZeJian
 * @Date: 2022-04-26 14:12:08
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-04-26 14:31:05
 * @Description: 
 */
const path = require('path');
function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: process.env.VUE_APP_BASE,
  outputDir: `dist${process.env.VUE_APP_BASE}`,
  assetsDir: 'static',
  lintOnSave: false,
  filenameHashing: false,
  css: {
    extract: true,
  },
  configureWebpack: {
    resolve: {
      extensions: ['.js', '.json', '.vue'],
      alias: {
        '@': path.resolve(__dirname, 'src/'),
      },
    }
  },
  chainWebpack: (config) => {
    config.optimization.delete('splitChunks');
  },
  devServer: {
    host: '0.0.0.0',
    port: 8070,
    open: true,
    proxy: {
      "/idaas/api": {
        target: `https://app.oars.gzsunrun.cn`,
        changeOrigin: true,
        pathRewrite: {
        }
      },
      "/filebase": {
        target: `https://app.oars.gzsunrun.cn`,
        changeOrigin: true,
        pathRewrite: { 
        }
      },
      "/oars-pan/api": {
        target: `http://127.0.0.1:8090`,
        changeOrigin: true,
        pathRewrite: {
        }
      },
      "/oars-terminal/api": {
        target: `http://127.0.0.1:8090`,
        changeOrigin: true,
        ws: true,
      },
    },
    disableHostCheck: true
  }
};
